<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\DB;

class CardaddModel extends Model
{
    protected $table='cardadd';

    public function product()
    {
        return $this->hasOne('App\Models\ProductsModel','id','product_name');
    }

    public static function getProduncts(){
        $datas=DB::table('products')->get();
        $array=[];
        foreach ($datas as $data){
            $array[$data->id]=$data->p_name;
        }
        return $array;
        /*foreach ($array11 as $key=>$value){
            echo $value['key'];
        }*/
    }
}
